CDataUtils.cs
Code Type: C# Class
Uses Classes: ListItem, }, StringBuilder, DataTable


Lines of Code: 739

public class CDataUtils

	Summary description for CDataUtils 

public CDataUtils()

	 constructor 

public string GetDateTimeAsString(DateTime dt)

	 used to retrieve a date/time in a string format for display 

public long GetDSLongValue(DataSet ds, string strField)

	 helper to get one value from a dataset as a long 

public string GetDSStringValue(DataSet ds, string strField)

	 helper to get one value from a dataset as a string value is sanitized to help prevent XSS 

public bool IsEmpty(DataSet ds)

	 helper to determine if a dataset is empty 

public DateTime GetDSDateTimeValue(DataSet ds, string strField)

	 helper to get a datetime value from a record 

public DateTime GetDSDateTimeValue(DataRow dr, string strField)

	 helper to get a datetime from a data row 

public string GetMonthAsText(int nMonth)

	 helper to get month abbreviation 

public string GetStringValueFromDS(DataSet ds, string strField)

	 helper to get 1 value from a dataset as a string value is sanitized to help prevent XSS 

public string GetDateValueAsStringFromDS(DataSet ds, string strField)

	 helper to get date value from a dataset as a string 

public long GetLongValueFromDS(DataSet ds, string strField)

	 helper to get 1 value from a dataset as a long 

public int GetIntValueFromDS(DataSet ds, string strField)

	 helper to get 1 value from a dataset as an integer 

public string GetCommaDelimitedValues(DataSet ds,
                                              string strColumnName)

	 gets the values from a dataset and splits them with commas ',' 

public string GetPipeDelimitedValues(DataSet ds,
                                              string strColumnName)

	 gets the values from a dataset and splits them with pipes '|' 

public void LoadCheckListBox(CheckBoxList chklst, DataSet ds, StateBag sb)

	 load a .net checkboxlist from a dataset 

public void LoadComboBox(ListBox cboList, DataSet ds)

	 load a .net combo box 

public void LoadRadioButtonListBox(RadioButtonList rblList, DataSet ds)

	 load a .net radio button list box 

public string GetDataParameterChunk(string strText,
                                             out string strLeftOver)

	get parameter chunk... 

public void HandleCheckBoxListChange(CheckBoxList chklst, StateBag sb)

	 handle a .net checklistbox change 

public bool SetSelectedRadioListValue(RadioButtonList rblList, string strValue)

	 set .net radio button list 

public string GetRadioListBoxValue(RadioButtonList rblList, int nValuePieceIndex)

	 get selected radiobox value 

public bool SetSelectedCheckListboxValues(CheckBoxList chklst, string strValues)

	 sets the selected checkbox values 

public bool SetSelectedCheckListboxValues(CheckBoxList chklst, ListBox lst, string strValues)

	 sets the selected checkbox values 

public string GetUnSelectedCheckListBoxValues(CheckBoxList chklst, int nValuePieceIndex)

	 gets the selected checkbox values 

public string GetSelectedCheckListBoxValues(CheckBoxList chklst, int nValuePieceIndex)

	 gets the selected checkbox values 

public string GetSelectedCheckListBoxText(CheckBoxList chklst)

	  get selected checkboxlist text 

public string GetListBoxValues(ListBox lst, int nValuePieceIndex)

	 gets the selected checkbox values 

public string GetListBoxText(ListBox lst)

	 gets the selected checkbox values 

public string GetCheckYesNoText(CheckBox chk)

	 get Yes/No text from checkbox 

public string GetLongValueAsString(long lValue)

	 get a long value as a string 

public double GetCurrencyValue(double dblPct, double dblValue)

	 get currency value 

public double GetPercentValue(string strPercent)

	 get percent value 

public int GetIntValue(string strInt)

	 get int value 

public long GetLongValue(string strLong)

	 get long value 

public double GetDoubleValue(string strDouble)

	 get double value 

public double GetCurrencyValue(string strCurrency)

	 get currency value 

public long GetLongValue(bool bValue)

	 get a long value 

public string GetPercentAsString(double dblPercent)

	 get percent as string 

public void SetCheckBoxValue(CheckBox chk, long lValue)

	 set .net checkbox value 

public bool GetSSNElements(string strSSN,
                                    out string strSSN1,
                                    out string strSSN2,
                                    out string strSSN3)

	 get ssn in pieces 

public DateTime GetDate(string strDateTime)

	 used to turn a mm/dd/yyyy string into a DateTime 

public string GetDateAsString(DateTime dt)

	 used to retrieve a date in a string format for display 

public string GetCurrentAgeAsString(DateTime dtDOB)

	 gets age as string from DOB passed in 

public void GetCurrentAge(DateTime dtDOB,
                                    out int years,
                                    out int months,
                                    out int days)

	 gets years months data from dob passed in 

public void GetAge(DateTime dtDOB,
                            DateTime dtAsOf,
                            out int years,
                            out int months,
                            out int days)

	 gets years months days from dom and asof date 

public string NumberToRoman(int number, bool bUppercase)

	 Converts an integer value into Roman numerals 

public string GetLetterOutline(int number, bool bUpercase)

	 get letter for outlining 

public string GetJSArray(DataSet ds, string strFields)

	 gets a JS array from ds and fields 

public bool ValidateCompareDates(string strDate1,
                                            string strDate2,
                                            string strRelation,
                                            out bool bIsValidDate1,
                                            out bool bIsValidDate2,
                                            out bool bComparison)

	 Validates two dates (string) and compares them ("before", "equal", "after") 

public string GetJSONString(DataSet ds)

	  getsjson string from ds 

public DataTable GetDataTable(DataSet ds)

	 gets a datatable from a dataset 

public bool OptionExists(DropDownList ctrl, string strOptionValue)

	 checks to see if option exists in ddl 

public bool OptionExists(CheckBoxList ctrl, string strOptionValue)

	 checks to see if option exists in checkboxlist 

public bool OptionExists(RadioButtonList ctrl, string strOptionValue)

	 checks to see if option exists in rbl 

public bool OptionExists(ListBox ctrl, string strOptionValue)

	 checks to see if option exists in listbox 

public bool OptionExists(ListControl ctrl, string strOptionValue)

	 checks to see if option exists in listcontrol 

	

